package com.wjj.sixinone.controller.open;

import com.wjj.sixinone.common.enums.ApiTypeConst;
import com.wjj.sixinone.common.pojo.dto.LoginDto;
import com.wjj.sixinone.common.util.Result;
import com.wjj.sixinone.service.FaceAiService;
import com.wjj.sixinone.service.OpenService;
import com.wjj.sixinone.service.ValidateCodeService;
import com.wjj.sixinone.service.impl.AIFaceServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@RestController
@RequestMapping(ApiTypeConst.API_PUBLIC)
public class OpenController {
    @Resource
    private OpenService openService;
    @Autowired
    private FaceAiService faceAiService;
    @Resource
    private ValidateCodeService validateCodeService;

    /**
     * 用于处理layui上传图片没设置url
     * @return
     */
    @PostMapping("/")

    public Result open(MultipartFile file){
        return Result.ok();
    }
    @PostMapping("/login")

    public Result Login(@RequestBody LoginDto loginDto){
        return openService.Login(loginDto);
    }


    @GetMapping("/generateValidateCode")
    @Operation(summary = "验证码生成接口")
    public Result generateCode(){
        return validateCodeService.generateCode();
    }

}
